import logging

levels = {
    "debug": logging.DEBUG,
    "info": logging.INFO,
    "warning": logging.WARNING
}
logger = logging.getLogger(__name__)

ch = logging.StreamHandler()
fl = logging.FileHandler('log.txt')
ch.setLevel(logging.DEBUG)
fl.setLevel(logging.DEBUG)

logger.addHandler(ch)
logger.addHandler(fl)

logger.setLevel(level=levels['debug'])
